/**
 * Copyright 2023 Inc.
 **/
package com.myz.leetcode;


import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * @author maoyz0621 on 2023/8/22
 * @version v1.0
 */
public class NiuCode {

    public static void main(String[] args) {
        int[] nums = {1, 3, 1, 3, 4};


        // int[] nums = {34, 6, 89, 72, 88, 0, 30, 9, 91};
        // System.out.println(a(nums));
        System.out.println(singleNum(nums));
    }

    /**
     * 最大数
     */
    static String largeNum(int[] nums) {
        int n = nums.length;
        String[] ss = new String[n];
        for (int i = 0; i < n; i++) {
            ss[i] = "" + nums[i];
        }
        Arrays.sort(ss, (a, b) -> {
            String ab = a + b, ba = b + a;
            return ba.compareTo(ab);
        });

        StringBuilder sb = new StringBuilder();
        for (String s : ss) {
            sb.append(s);
        }

        int len = sb.length();
        int k = 0;
        while (k < len - 1 && sb.charAt(k) == '0') {
            k++;
        }
        return sb.substring(k);
    }

    /**
     * 值出现一次的数字
     */
    static int singleNum(int[] nums) {
        int val = 0;
        for (int num : nums) {
            val ^= num;
        }
        return val;
    }

    public static void main0() {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int b = in.nextInt();
        int max = 40;
        String nextLine;
        List<Integer> list = new ArrayList<>();
        String[] split = new String[]{};

        while (in.hasNextLine()) { // 注意 while 处理多个 case
            nextLine = in.nextLine();
            // 跳出空格
            if (StringUtils.isEmpty(nextLine)) {
                continue;
            }
            // 全部读取
            String trim = nextLine.trim();
            // 空格或换行，回车
            split = trim.split("\\s+");

            int pos = -1;
            int maxLen = 0;
            int nowLen = 0;
            for (int i = 0; i < split.length; i++) {
                if (Integer.parseInt(split[i]) == b) {
                    nowLen++;
                    // 最后一位判断
                    if (i == split.length - 1) {
                        if (nowLen > maxLen) {
                            maxLen = nowLen;
                            pos = i;
                        }
                    }
                } else {
                    if (nowLen > maxLen) {
                        maxLen = nowLen;
                        pos = i;
                    }
                    nowLen = 0;
                }
            }

            System.out.println(pos);
        }


    }
}